package com.time.sky.controller;


import com.time.sky.entity.Water;
import com.time.sky.mapper.WaterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class WaterController {

    @Autowired
    private WaterMapper waterMapper;

    @CrossOrigin
    @RequestMapping("/water/selectWaterList")
    public List<Water> selectWaterList(@RequestBody  Water water){
        return waterMapper.selectWater(water);
    }

    @CrossOrigin
    @RequestMapping("/water/findAll")
    public List<Water> findAll(){
        return waterMapper.findAll();
    }

}
